#include<stdio.h>
#include<math.h>
int IsPrimer(int x)
{
    int flag = 0;
    int q = int(sqrt(x));
    for(int i = 2; i <= q;i++)
    {
        if(x % i == 0) flag = 1;
    }
    if(flag == 0) 
    {
        return 1;
    }
    else
    {
        return 0;
    }
}
int main()
{
    //freopen("in.txt","r",stdin);
    int L;
    scanf("%d",&L);
    int count = 0;
    int i = 2;
    int sum = 0;
    do
    {
        if(IsPrimer(i))
        {
            sum+=i;
            if(sum <= L)
            {
                printf("%d\n",i);
                count++;
            }
        }
        i++;
    } while (sum <= L);
    
    printf("%d\n",count);
}